home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume10 / gb3 / patch2d < prev    next >
Encoding:
Internet Message Format  |  1990-08-28  |  59.0 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i042:  gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2d
  5. Message-ID: <6229@tekred.CNA.TEK.COM>
  6. Date: 28 Aug 90 19:35:31 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1890
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: VANCLEEF@mps.ohio-state.edu
  12. Posting-number: Volume 11, Issue 42
  13. Archive-name: gb3/Patch2d
  14. Patch-To: gb3: Volume 10, Issue 1-14
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 4 (of 9)."
  25. # Contents:  Docs/victory.doc patches02a
  26. # Wrapped by billr@saab on Tue Aug 28 08:54:55 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'Docs/victory.doc' -a "${1}" != "-c" ; then 
  29.   echo shar: Renaming existing file \"'Docs/victory.doc'\" to \"'Docs/victory.doc.orig'\"
  30.   mv -f 'Docs/victory.doc' 'Docs/victory.doc.orig'
  31. fi
  32. echo shar: Extracting \"'Docs/victory.doc'\" \(2059 characters\)
  33. sed "s/^X//" >'Docs/victory.doc' <<'END_OF_FILE'
  34. X
  35. XNOTE: THIS IS A TENTATIVE IDEA AND HAS NOT BEEN OFFICIALLY
  36. XDECIDED UPON. USE AT YOUR OWN RISK :)
  37. X
  38. X
  39. X  VICTORY CONDITIONS FOR GB
  40. X  =========================
  41. X
  42. X THE RULES:
  43. X ==========
  44. X
  45. X  1) victory conditions are based on the control of systems (idea of 16)
  46. X     a system is controlled by a block, if all occupied sectors belong 
  47. X     to members of the block at that turn.
  48. X
  49. X  2) each block gets 10 Victory Point (VP) for every system it holds every turn
  50. X
  51. X  3) the block wich has more 130% of the VP's of any other block wins the game
  52. X
  53. X
  54. X THE MOTIVATION:
  55. X ===============
  56. X
  57. XSearching for victory contidions (VC), I wanted something that would
  58. Xrelate to the number of planets the block holds. However the number of
  59. Xplanets, the number of sectors, number of resource points, ... all
  60. Xthese things are unsuitable, since they are almost impossible to alter
  61. Xin say a month of playing. Thus whatever counts for VC's has to be a
  62. Xrather small number and has to be somewhat volatile. Also, while
  63. Xgiving them some advantage, it should be possible for a number of
  64. Xsmall players to win against one big one. The scenario I envision
  65. Xallows for this:
  66. X
  67. X1) To remove a system from another player, all you need to do is
  68. Xoccupy one sector in the system. It will not count for you, neither
  69. Xwill it for him. A large player will be hard pressed to constantly
  70. Xfend off 10 small ones, if all they have to do is hold one sector.
  71. X
  72. X2) The core systems of large and small players alike (like most
  73. Xpeoples home systems) will pretty much by default contribute to their 
  74. XVP's. Thats ok. But the size of the system, you luck getting a good ot
  75. Xbad one, will not influence this. 
  76. X
  77. X3) Aside from the core systems there will be a small number of systems
  78. Xwhich tilt the balance. These and only these will be fought for.
  79. XIn order to win you need control of these system, which is hard, but
  80. XALOT easier than winning by say sector numbers ....
  81. X
  82. X4) These crucial systems will be picked strategically (i hope) by the
  83. Xplayers they do not depend on some random initial choice when the
  84. Xgalaxy is created. 
  85. X
  86. X
  87. XWW
  88. END_OF_FILE
  89. if test 2059 -ne `wc -c <'Docs/victory.doc'`; then
  90.     echo shar: \"'Docs/victory.doc'\" unpacked with wrong size!
  91. fi
  92. # end of 'Docs/victory.doc'
  93. if test -f 'patches02a' -a "${1}" != "-c" ; then 
  94.   echo shar: Renaming existing file \"'patches02a'\" to \"'patches02a.orig'\"
  95.   mv -f 'patches02a' 'patches02a.orig'
  96. fi
  97. echo shar: Extracting \"'patches02a'\" \(54235 characters\)
  98. sed "s/^X//" >'patches02a' <<'END_OF_FILE'
  99. X*** /usr/cna/billr/games/gb3/README    Fri Jun  1 11:52:49 1990
  100. X--- README    Thu Aug 23 14:00:15 1990
  101. X***************
  102. X*** 32,38 ****
  103. X  then tells the server to do an update. The default update time is 4 hours, 
  104. X  but you can change that with 'GB_daemon <hours between updates>'. It is a 
  105. X  good idea to make your update times a factor of 24 hours. If you want to
  106. X! force an update just do 'GB_doturn' by itself.
  107. X  
  108. X  Players cannot enroll by themselves in this version. The game's host
  109. X  must do that by running 'GB_enroll' and following the instructions. It
  110. X--- 32,38 ----
  111. X  then tells the server to do an update. The default update time is 4 hours, 
  112. X  but you can change that with 'GB_daemon <hours between updates>'. It is a 
  113. X  good idea to make your update times a factor of 24 hours. If you want to
  114. X! force an update just telnet to the server and enter the update password.
  115. X  
  116. X  Players cannot enroll by themselves in this version. The game's host
  117. X  must do that by running 'GB_enroll' and following the instructions. It
  118. X***************
  119. X*** 71,73 ****
  120. X--- 71,81 ----
  121. X  Bill Randle
  122. X  billr@saab.CNA.TEK.COM
  123. X  6/1/90
  124. X+ 
  125. X+ 
  126. X+ Patchlevel 2 reflects the changes necessary to bring this version up
  127. X+ to level 1.3.1 client and level 2.2.3 server.
  128. X+ 
  129. X+ Bill Randle
  130. X+ billr@saab.CNA.TEK.COM
  131. X+ 8/24/90
  132. X*** /usr/cna/billr/games/gb3/README_ORIG    Wed May 30 15:10:28 1990
  133. X--- README_ORIG    Wed Aug 22 11:42:01 1990
  134. X***************
  135. X*** 1,3 ****
  136. X--- 1,6 ----
  137. X+ (Note: This is the README which came along with GB .975 in April 1989 -
  138. X+     It is currently outdated and is included for historical interest only - G.vC)
  139. X+ 
  140. X  
  141. X      This is a game of interstellar exploration/conquest.  By the time I
  142. X  realized there really wasn't going to be much fighting going on in the game, I
  143. X*** /usr/cna/billr/games/gb3/server/GB_server.c    Thu May 31 10:10:25 1990
  144. X--- server/GB_server.c    Fri Aug 24 15:02:35 1990
  145. X***************
  146. X*** 45,51 ****
  147. X  #include <netinet/in.h>
  148. X  #include <netdb.h>
  149. X  
  150. X! /*#include <time.h>    /* included by <sys/time.h> with bsd */
  151. X  #include <sys/timeb.h>
  152. X  
  153. X  #include <curses.h>
  154. X--- 45,51 ----
  155. X  #include <netinet/in.h>
  156. X  #include <netdb.h>
  157. X  
  158. X! /*#include <time.h>*/
  159. X  #include <sys/timeb.h>
  160. X  
  161. X  #include <curses.h>
  162. X***************
  163. X*** 84,94 ****
  164. X  char start_buf[128];
  165. X  char update_buf[128];
  166. X  
  167. X! static const char *connect_fail = "Connection refused.\n";
  168. X! static const char *create_fail = "Connection refused.\n";
  169. X! static const char *flushed_message = "<Output Flushed>\n";
  170. X! static const char *shutdown_message = "Shutdown ordered by deity - Bye\n";
  171. X! static const char *already_on = "Connection refused.\n";
  172. X  
  173. X  int errno;
  174. X  
  175. X--- 84,93 ----
  176. X  char start_buf[128];
  177. X  char update_buf[128];
  178. X  
  179. X! static char *connect_fail = "Connection refused.\n";
  180. X! static char *flushed_message = "<Output Flushed>\n";
  181. X! static char *shutdown_message = "Shutdown ordered by deity - Bye\n";
  182. X! static char *already_on = "Connection refused.\n";
  183. X  
  184. X  int errno;
  185. X  
  186. X***************
  187. X*** 134,140 ****
  188. X  void welcome_user();
  189. X  void check_connect();
  190. X  void close_sockets();
  191. X! const char *addrout ();
  192. X  void dump_users();
  193. X  void set_signals();
  194. X  struct descriptor_data *new_connection();
  195. X--- 133,139 ----
  196. X  void welcome_user();
  197. X  void check_connect();
  198. X  void close_sockets();
  199. X! char *addrout ();
  200. X  void dump_users();
  201. X  void set_signals();
  202. X  struct descriptor_data *new_connection();
  203. X***************
  204. X*** 180,187 ****
  205. X  {
  206. X  int maim_stardata, s; 
  207. X  int i, j, dummy;
  208. X- #ifdef BSD4_2
  209. X  char zone[16];
  210. X  struct timeval tp;
  211. X  struct timezone tzp;
  212. X  #endif
  213. X--- 179,186 ----
  214. X  {
  215. X  int maim_stardata, s; 
  216. X  int i, j, dummy;
  217. X  char zone[16];
  218. X+ #ifdef BSD4_2
  219. X  struct timeval tp;
  220. X  struct timezone tzp;
  221. X  #endif
  222. X***************
  223. X*** 222,260 ****
  224. X      }
  225. X      Putblock(Blocks);
  226. X  
  227. X! Num_races = Numraces();
  228. X! /* compute alliance block power */
  229. X! sprintf(Power_blocks.time, "%2d/%2d/%d %02d:%02d:%02d %s", 
  230. X!     current_tm->tm_mon+1, current_tm->tm_mday,
  231. X!     current_tm->tm_year, current_tm->tm_hour,
  232. X!     current_tm->tm_min, current_tm->tm_sec, zone);
  233. X!  for (i=1; i<=Num_races; i++) {
  234. X!     dummy=(Blocks[i-1].invite & Blocks[i-1].pledge);
  235. X!                 Power_blocks.members[i-1] = 0;
  236. X!                 Power_blocks.sectors_owned[i-1] = 0;
  237. X!                 Power_blocks.popn[i-1] = 0;
  238. X!                 Power_blocks.ships_owned[i-1] = 0;
  239. X!                 Power_blocks.planets_owned[i-1] = 0;
  240. X!                 Power_blocks.resource[i-1] = 0;
  241. X!                 Power_blocks.fuel[i-1] = 0;
  242. X!                 Power_blocks.destruct[i-1] = 0;
  243. X!                 Power_blocks.VPs[i-1] = 0;
  244. X!     for(j=1; j<=Num_races; j++) 
  245. X!             if(isset(dummy, j)){
  246. X!                 Power_blocks.members[i-1] += 1;
  247. X!                 Power_blocks.sectors_owned[i-1] += Power[j-1].sectors_owned;
  248. X!                 Power_blocks.popn[i-1] += Power[j-1].popn;
  249. X!                 Power_blocks.ships_owned[i-1] += Power[j-1].ships_owned;
  250. X!                 Power_blocks.planets_owned[i-1] += Power[j-1].planets_owned;
  251. X!                 Power_blocks.resource[i-1] += Power[j-1].resource;
  252. X!                 Power_blocks.fuel[i-1] += Power[j-1].fuel;
  253. X!                 Power_blocks.destruct[i-1] += Power[j-1].destruct;
  254. X!                 Power_blocks.VPs[i-1] += Blocks[j-1].VPs;
  255. X!             }
  256. X!     }
  257. X  
  258. X- 
  259. X- 
  260. X      shovechars (argc==1 ? GB_PORT : atoi (argv[1]) );
  261. X      close_sockets ();
  262. X  printf("Going down.\n");
  263. X--- 221,228 ----
  264. X      }
  265. X      Putblock(Blocks);
  266. X  
  267. X! compute_power_blocks();
  268. X  
  269. X      shovechars (argc==1 ? GB_PORT : atoi (argv[1]) );
  270. X      close_sockets ();
  271. X  printf("Going down.\n");
  272. X***************
  273. X*** 363,369 ****
  274. X--- 331,339 ----
  275. X          return;
  276. X          }
  277. X      } else {
  278. X+ 
  279. X          (void) time (&now);
  280. X+ 
  281. X          if (FD_ISSET (sock, &input_set)) {
  282. X          if (!(newd = new_connection (sock))) {
  283. X              if (errno != EINTR && errno != EMFILE) {
  284. X***************
  285. X*** 375,384 ****
  286. X              maxd = newd->descriptor + 1;
  287. X          }
  288. X          }
  289. X          for (d = descriptor_list; d; d = dnext) {
  290. X          dnext = d->next;
  291. X          if (FD_ISSET (d->descriptor, &input_set)) {
  292. X!             d->last_time = now;
  293. X              if (!process_input (d)) {
  294. X                  shutdownsock (d);
  295. X                  continue;
  296. X--- 345,355 ----
  297. X              maxd = newd->descriptor + 1;
  298. X          }
  299. X          }
  300. X+ 
  301. X          for (d = descriptor_list; d; d = dnext) {
  302. X          dnext = d->next;
  303. X          if (FD_ISSET (d->descriptor, &input_set)) {
  304. X! /*            d->last_time = now; */
  305. X              if (!process_input (d)) {
  306. X                  shutdownsock (d);
  307. X                  continue;
  308. X***************
  309. X*** 390,395 ****
  310. X--- 361,367 ----
  311. X              }
  312. X          }
  313. X          }
  314. X+ 
  315. X      }
  316. X      }
  317. X  }
  318. X***************
  319. X*** 460,466 ****
  320. X      }
  321. X  }
  322. X  
  323. X! const char *addrout(a)
  324. X  long a;
  325. X  {
  326. X      static char outbuf[1024];
  327. X--- 432,438 ----
  328. X      }
  329. X  }
  330. X  
  331. X! char *addrout(a)
  332. X  long a;
  333. X  {
  334. X      static char outbuf[1024];
  335. X***************
  336. X*** 536,542 ****
  337. X  }
  338. X  
  339. X  struct text_block *make_text_block(s, n)
  340. X! const char *s;
  341. X  int n;
  342. X  {
  343. X      struct text_block *p;
  344. X--- 508,514 ----
  345. X  }
  346. X  
  347. X  struct text_block *make_text_block(s, n)
  348. X! char *s;
  349. X  int n;
  350. X  {
  351. X      struct text_block *p;
  352. X***************
  353. X*** 559,565 ****
  354. X  
  355. X  void add_to_queue(q, b, n)
  356. X  struct text_queue *q;
  357. X! const char *b;
  358. X  int n;
  359. X  {
  360. X      struct text_block *p;
  361. X--- 531,537 ----
  362. X  
  363. X  void add_to_queue(q, b, n)
  364. X  struct text_queue *q;
  365. X! char *b;
  366. X  int n;
  367. X  {
  368. X      struct text_block *p;
  369. X***************
  370. X*** 598,604 ****
  371. X  
  372. X  int queue_write(d, b, n)
  373. X  struct descriptor_data *d;
  374. X! const char *b;
  375. X  int n;
  376. X  {
  377. X      int space;
  378. X--- 570,576 ----
  379. X  
  380. X  int queue_write(d, b, n)
  381. X  struct descriptor_data *d;
  382. X! char *b;
  383. X  int n;
  384. X  {
  385. X      int space;
  386. X***************
  387. X*** 613,619 ****
  388. X  
  389. X  int queue_string(d, s)
  390. X  struct descriptor_data *d;
  391. X! const char *s;
  392. X  {
  393. X      return queue_write (d, s, strlen (s));
  394. X  }
  395. X--- 585,591 ----
  396. X  
  397. X  int queue_string(d, s)
  398. X  struct descriptor_data *d;
  399. X! char *s;
  400. X  {
  401. X      return queue_write (d, s, strlen (s));
  402. X  }
  403. X***************
  404. X*** 646,651 ****
  405. X--- 618,632 ----
  406. X      return 1;
  407. X  }
  408. X  
  409. X+ void force_output()
  410. X+ {
  411. X+     struct descriptor_data *d;
  412. X+ 
  413. X+     for (d = descriptor_list; d; d = d->next)
  414. X+         if (d->connected)
  415. X+             process_output(d);
  416. X+ }
  417. X+ 
  418. X  void make_nonblocking(s)
  419. X  int s;
  420. X  {
  421. X***************
  422. X*** 723,733 ****
  423. X  void goodbye_user(d)
  424. X  struct descriptor_data *d;
  425. X  {
  426. X      write (d->descriptor, LEAVE_MESSAGE, strlen (LEAVE_MESSAGE));
  427. X  }
  428. X  
  429. X  char *strsave (s)
  430. X! const char *s;
  431. X  {
  432. X      char *p;
  433. X  
  434. X--- 704,715 ----
  435. X  void goodbye_user(d)
  436. X  struct descriptor_data *d;
  437. X  {
  438. X+ if(d->connected) /* this can happen, especially after updates */
  439. X      write (d->descriptor, LEAVE_MESSAGE, strlen (LEAVE_MESSAGE));
  440. X  }
  441. X  
  442. X  char *strsave (s)
  443. X! char *s;
  444. X  {
  445. X      char *p;
  446. X  
  447. X***************
  448. X*** 740,746 ****
  449. X  
  450. X  void save_command (d, command)
  451. X  struct descriptor_data *d;
  452. X! const char *command;
  453. X  
  454. X  {
  455. X      add_to_queue (&d->input, command, strlen(command)+1);
  456. X--- 722,728 ----
  457. X  
  458. X  void save_command (d, command)
  459. X  struct descriptor_data *d;
  460. X! char *command;
  461. X  
  462. X  {
  463. X      add_to_queue (&d->input, command, strlen(command)+1);
  464. X***************
  465. X*** 783,789 ****
  466. X  
  467. X  void set_userstring (userstring, command)
  468. X  char **userstring;
  469. X! const char *command;
  470. X  {
  471. X      if (*userstring) {
  472. X      free(*userstring);
  473. X--- 765,771 ----
  474. X  
  475. X  void set_userstring (userstring, command)
  476. X  char **userstring;
  477. X! char *command;
  478. X  {
  479. X      if (*userstring) {
  480. X      free(*userstring);
  481. X***************
  482. X*** 795,810 ****
  483. X      *userstring = strsave (command);
  484. X  }
  485. X  
  486. X- #ifdef __STDC__
  487. X- void process_commands(void)
  488. X- #else
  489. X  void process_commands()
  490. X- #endif
  491. X  {
  492. X      int nprocessed;
  493. X      struct descriptor_data *d, *dnext;
  494. X      struct text_block *t;
  495. X  
  496. X      do {
  497. X      nprocessed = 0;
  498. X      for (d = descriptor_list; d; d = dnext) {
  499. X--- 777,792 ----
  500. X      *userstring = strsave (command);
  501. X  }
  502. X  
  503. X  void process_commands()
  504. X  {
  505. X      int nprocessed;
  506. X+     long now;
  507. X      struct descriptor_data *d, *dnext;
  508. X      struct text_block *t;
  509. X  
  510. X+ 
  511. X+     (void) time (&now);
  512. X+ 
  513. X      do {
  514. X      nprocessed = 0;
  515. X      for (d = descriptor_list; d; d = dnext) {
  516. X***************
  517. X*** 816,825 ****
  518. X--- 798,809 ----
  519. X          if (!do_command (d, t -> start)) {
  520. X              shutdownsock (d);
  521. X          } else {
  522. X+             d->last_time = now;    /* experimental code */
  523. X              d -> input.head = t -> nxt;
  524. X              if (!d -> input.head)
  525. X              d -> input.tail = &d -> input.head;
  526. X              free_text_block (t);
  527. X+             d->last_time = now;    /* experimental code */
  528. X          }
  529. X  
  530. X          }
  531. X***************
  532. X*** 860,873 ****
  533. X      if(d->connected) {
  534. X  
  535. X      openracedata(&server_racedata);
  536. X!           getrace(server_racedata, &r, d->Playernum);
  537. X      close_file(server_racedata);
  538. X  
  539. X!          sprintf(buf, "%s (%d) logged out.\n", r->name, d->Playernum);
  540. X          for(i=1; i<=Numraces(); i++)
  541. X          if(!Dir[i-1].gag)
  542. X                        notify(i, buf);
  543. X!             }
  544. X      goodbye_user (d);
  545. X      return 0;
  546. X      } else if (!strcmp (args[0], WHO_COMMAND)) {
  547. X--- 844,858 ----
  548. X      if(d->connected) {
  549. X  
  550. X      openracedata(&server_racedata);
  551. X!     getrace(server_racedata, &r, (int)d->Playernum);
  552. X      close_file(server_racedata);
  553. X  
  554. X!          sprintf(buf, "%s [%d] logged out.\n", r->name, d->Playernum);
  555. X          for(i=1; i<=Numraces(); i++)
  556. X          if(!Dir[i-1].gag)
  557. X                        notify(i, buf);
  558. X!     free(r);
  559. X!     }
  560. X      goodbye_user (d);
  561. X      return 0;
  562. X      } else if (!strcmp (args[0], WHO_COMMAND)) {
  563. X***************
  564. X*** 889,909 ****
  565. X              }    
  566. X      }
  567. X      }
  568. X      return 1;
  569. X  }
  570. X  
  571. X  void check_connect (d, msg)
  572. X  struct descriptor_data *d;
  573. X! const char *msg;
  574. X  {
  575. X      char password[MAX_COMMAND_LEN];
  576. X      reg int i;
  577. X!     int Playernum, Num_races;
  578. X      racetype *r;
  579. X      struct descriptor_data *d0, *dnext;
  580. X- #ifdef BSD4_2
  581. X      char zone[16];
  582. X- #endif
  583. X  
  584. X      parse_connect (msg,  password);
  585. X  
  586. X--- 874,893 ----
  587. X              }    
  588. X      }
  589. X      }
  590. X+ 
  591. X      return 1;
  592. X  }
  593. X  
  594. X  void check_connect (d, msg)
  595. X  struct descriptor_data *d;
  596. X! char *msg;
  597. X  {
  598. X      char password[MAX_COMMAND_LEN];
  599. X      reg int i;
  600. X!     int Playernum, Num_races, racefile;
  601. X      racetype *r;
  602. X      struct descriptor_data *d0, *dnext;
  603. X      char zone[16];
  604. X  
  605. X      parse_connect (msg,  password);
  606. X  
  607. X***************
  608. X*** 914,920 ****
  609. X  for (i=1; i<=Num_races; i++)
  610. X      notify(i, "DOING UPDATE...\n");
  611. X  
  612. X! 
  613. X      clk = time(0);
  614. X      update_tm=localtime(&clk);
  615. X  #ifdef BSD4_2
  616. X--- 898,904 ----
  617. X  for (i=1; i<=Num_races; i++)
  618. X      notify(i, "DOING UPDATE...\n");
  619. X  
  620. X! force_output();
  621. X      clk = time(0);
  622. X      update_tm=localtime(&clk);
  623. X  #ifdef BSD4_2
  624. X***************
  625. X*** 922,927 ****
  626. X--- 906,925 ----
  627. X  #else
  628. X      strcpy(zone, update_tm->tm_zone);
  629. X  #endif
  630. X+ 
  631. X+ /* if hour is 0, allocate daily login time */
  632. X+ if(!update_tm->tm_hour) {
  633. X+ openracedata(&racefile);
  634. X+     for (i=1; i<=Num_races; i++) {
  635. X+     getrace(racefile, &r, i);
  636. X+     r->daily = DAILY*60;
  637. X+     if(!(update_tm->tm_mday%7))
  638. X+         r->weekly = WEEKLY*60;
  639. X+     putrace(racefile, r);
  640. X+     }
  641. X+ close_file(racefile);
  642. X+ }
  643. X+ 
  644. X  sprintf(Power_blocks.time, "%2d/%2d/%d %02d:%02d:%02d %s", 
  645. X      update_tm->tm_mon+1, update_tm->tm_mday,
  646. X      update_tm->tm_year, update_tm->tm_hour,
  647. X***************
  648. X*** 930,937 ****
  649. X      update_tm->tm_mon+1, update_tm->tm_mday,
  650. X      update_tm->tm_year, update_tm->tm_hour,
  651. X      update_tm->tm_min, update_tm->tm_sec, zone);
  652. X!     do_turn();
  653. X!     return;
  654. X      }
  655. X  
  656. X  
  657. X--- 928,937 ----
  658. X      update_tm->tm_mon+1, update_tm->tm_mday,
  659. X      update_tm->tm_year, update_tm->tm_hour,
  660. X      update_tm->tm_min, update_tm->tm_sec, zone);
  661. X! 
  662. X!         do_turn();
  663. X! 
  664. X! return;
  665. X      }
  666. X  
  667. X  
  668. X***************
  669. X*** 944,950 ****
  670. X      } else {
  671. X  
  672. X      openracedata(&server_racedata);
  673. X!           getrace(server_racedata, &r, i);
  674. X      close_file(server_racedata);
  675. X  
  676. X            Playernum = r->Playernum;
  677. X--- 944,950 ----
  678. X      } else {
  679. X  
  680. X      openracedata(&server_racedata);
  681. X!     getrace(server_racedata, &r, (int)i);
  682. X      close_file(server_racedata);
  683. X  
  684. X            Playernum = r->Playernum;
  685. X***************
  686. X*** 958,976 ****
  687. X          }
  688. X      }
  689. X  
  690. X!         fprintf (stderr, "CONNECTED %s(%d) on descriptor %d\n",
  691. X               r->name, Playernum, d->descriptor);
  692. X          d->connected = 1;
  693. X          d->Playernum = Playernum;
  694. X  
  695. X!         sprintf(buf,"\nLogged in as %s (%d).\n",r->name,Playernum);
  696. X          notify(Playernum, buf);
  697. X       
  698. X!         sprintf(buf, "%s (%d) logged on.\n", r->name, Playernum);
  699. X          for(i=1; i<=Numraces(); i++)
  700. X                    if(i != Playernum && !Dir[i-1].gag) notify(i, buf);
  701. X  
  702. X!     GB_time(Playernum);
  703. X      if (r->Gov_ship==0) {
  704. X          sprintf(buf,"You have no Governmental Center.  No action points will be produced\nuntil you build one and designate a capital.\n");
  705. X          notify(Playernum, buf);
  706. X--- 958,977 ----
  707. X          }
  708. X      }
  709. X  
  710. X!         fprintf (stderr, "CONNECTED %s [%d] on descriptor %d\n",
  711. X               r->name, Playernum, d->descriptor);
  712. X          d->connected = 1;
  713. X          d->Playernum = Playernum;
  714. X  
  715. X!         sprintf(buf,"\nLogged in as %s [%d].\n",r->name,Playernum);
  716. X          notify(Playernum, buf);
  717. X       
  718. X!         sprintf(buf, "%s [%d] logged on.\n", r->name, Playernum);
  719. X          for(i=1; i<=Numraces(); i++)
  720. X                    if(i != Playernum && !Dir[i-1].gag) notify(i, buf);
  721. X  
  722. X!     GB_time(Playernum, r, 0);
  723. X!     if(r->standby) notify(Playernum, "Standing by\n");
  724. X      if (r->Gov_ship==0) {
  725. X          sprintf(buf,"You have no Governmental Center.  No action points will be produced\nuntil you build one and designate a capital.\n");
  726. X          notify(Playernum, buf);
  727. X***************
  728. X*** 978,988 ****
  729. X          sprintf(buf,"Government Center #%d is active.\n", r->Gov_ship);
  730. X          notify(Playernum, buf);
  731. X          }
  732. X!     }
  733. X  }
  734. X  
  735. X  void parse_connect (msg, pass)
  736. X! const char *msg;
  737. X  char *pass;
  738. X  {
  739. X      char *p;
  740. X--- 979,994 ----
  741. X          sprintf(buf,"Government Center #%d is active.\n", r->Gov_ship);
  742. X          notify(Playernum, buf);
  743. X          }
  744. X!     if(!r->daily) {
  745. X!         notify(Playernum, "You have no daily active time left.\n");
  746. X!         }
  747. X! 
  748. X!     free(r);
  749. X!     }
  750. X  }
  751. X  
  752. X  void parse_connect (msg, pass)
  753. X! char *msg;
  754. X  char *pass;
  755. X  {
  756. X      char *p;
  757. X***************
  758. X*** 995,1005 ****
  759. X      *p = '\0';
  760. X  }
  761. X  
  762. X- #ifdef __STDC__
  763. X- void close_sockets(void)
  764. X- #else
  765. X  void close_sockets()
  766. X- #endif
  767. X  {
  768. X      struct descriptor_data *d, *dnext;
  769. X  
  770. X--- 1001,1007 ----
  771. X***************
  772. X*** 1013,1034 ****
  773. X      close (sock);
  774. X  }
  775. X  
  776. X- #ifdef __STDC__
  777. X- void emergency_shutdown(void)
  778. X- #else
  779. X  void emergency_shutdown()
  780. X- #endif
  781. X  {
  782. X      close_sockets();
  783. X  }
  784. X  
  785. X! #ifdef __STDC__
  786. X! int bailout(int sig, int code, struct sigcontext *scp)
  787. X! #else
  788. X! int bailout(sig, code, scp)
  789. X! int sig, code;
  790. X  struct sigcontext *scp;
  791. X- #endif
  792. X  {
  793. X      char message[1024];
  794. X      
  795. X--- 1015,1029 ----
  796. X      close (sock);
  797. X  }
  798. X  
  799. X  void emergency_shutdown()
  800. X  {
  801. X      close_sockets();
  802. X  }
  803. X  
  804. X! int bailout(sig ,code,scp)
  805. X! int sig;
  806. X! int code;
  807. X  struct sigcontext *scp;
  808. X  {
  809. X      char message[1024];
  810. X      
  811. X***************
  812. X*** 1038,1048 ****
  813. X      return 0;
  814. X  }
  815. X  
  816. X- #ifdef __STDC__
  817. X- int dump_status(void)
  818. X- #else
  819. X  int dump_status()
  820. X- #endif
  821. X  {
  822. X      struct descriptor_data *d;
  823. X      long now;
  824. X--- 1033,1039 ----
  825. X***************
  826. X*** 1053,1061 ****
  827. X  openracedata(&server_racedata);
  828. X      for (d = descriptor_list; d; d = d->next) {
  829. X      if (d->connected) {
  830. X!         getrace(server_racedata, &r, d->Playernum);
  831. X          fprintf (stderr, "PLAYING descriptor %d Playernum %s(%d)",
  832. X               d->descriptor, r->name, d->Playernum);
  833. X  
  834. X          if (d->last_time)
  835. X          fprintf (stderr, " idle %d seconds\n",
  836. X--- 1044,1053 ----
  837. X  openracedata(&server_racedata);
  838. X      for (d = descriptor_list; d; d = d->next) {
  839. X      if (d->connected) {
  840. X!         getrace(server_racedata, &r, (int)d->Playernum);
  841. X          fprintf (stderr, "PLAYING descriptor %d Playernum %s(%d)",
  842. X               d->descriptor, r->name, d->Playernum);
  843. X+         free(r);
  844. X  
  845. X          if (d->last_time)
  846. X          fprintf (stderr, " idle %d seconds\n",
  847. X***************
  848. X*** 1087,1120 ****
  849. X  openracedata(&server_racedata);
  850. X      for (d = descriptor_list; d; d = d->next) {
  851. X      if (d->connected) {
  852. X!         getrace(server_racedata, &r, d->Playernum);
  853. X  
  854. X          if (d->last_time)
  855. X!         sprintf (buf, "%20s (%3d)     seconds idle %d\n", r->name, 
  856. X!             d->Playernum, now - d->last_time);
  857. X          else
  858. X!         sprintf (buf, "%20s (%3d)     idle forever\n", r->name, d->Playernum);
  859. X          queue_string (e, buf);
  860. X      }
  861. X      }
  862. X  close_file(server_racedata);
  863. X  }
  864. X  
  865. X  void process_command(Playernum, command) 
  866. X  /* locate and parse the command for processing */
  867. X  int Playernum;
  868. X  char *command;
  869. X  {
  870. X! int i,argn=0;
  871. X  boolean parse_exit=0;
  872. X  char args[MAXARGS][COMMANDSIZE];
  873. X  char *string, *announcement, *dummy;
  874. X  
  875. X- openracedata(&server_racedata);
  876. X- free(Race);
  877. X- getrace(server_racedata, &Race, Playernum);
  878. X- close_file(server_racedata);
  879. X- 
  880. X      string=command;    /* make pointers the same */
  881. X  
  882. X      while (!parse_exit) {
  883. X--- 1079,1129 ----
  884. X  openracedata(&server_racedata);
  885. X      for (d = descriptor_list; d; d = d->next) {
  886. X      if (d->connected) {
  887. X!         getrace(server_racedata, &r, (int)d->Playernum);
  888. X  
  889. X          if (d->last_time)
  890. X!         sprintf (buf, "%20s [%2d] [%d:%d] seconds idle %d %s %s\n", r->name, 
  891. X!             d->Playernum, r->weekly/60, r->daily/60, now - d->last_time, (r->gag ? "GAG": ""),
  892. X!             (r->standby ? "STAND BY" : ""));
  893. X          else
  894. X!         sprintf (buf, "%20s [%2d] idle forever\n", r->name, d->Playernum);
  895. X          queue_string (e, buf);
  896. X+         free(r);
  897. X+         if((now - d->last_time) > DISCONNECT_TIME)
  898. X+         d->connected = 0;
  899. X      }
  900. X      }
  901. X  close_file(server_racedata);
  902. X  }
  903. X  
  904. X+ int daily_time(r)
  905. X+ racetype *r;
  906. X+ {
  907. X+     struct descriptor_data *d;
  908. X+     long now;
  909. X+     int time_left;
  910. X+ 
  911. X+     time_left = r->daily;
  912. X+     
  913. X+     (void) time (&now);
  914. X+     for (d = descriptor_list; d; d = d->next)
  915. X+     if (d->connected && d->last_time && (d->Playernum==r->Playernum)) {
  916. X+         time_left = MAX(0, r->daily - (now - d->last_time));
  917. X+     }
  918. X+     return time_left;
  919. X+ }
  920. X+ 
  921. X  void process_command(Playernum, command) 
  922. X  /* locate and parse the command for processing */
  923. X  int Playernum;
  924. X  char *command;
  925. X  {
  926. X! int i, j,argn=0, God, ok, old;
  927. X  boolean parse_exit=0;
  928. X  char args[MAXARGS][COMMANDSIZE];
  929. X  char *string, *announcement, *dummy;
  930. X+ racetype *r;
  931. X  
  932. X      string=command;    /* make pointers the same */
  933. X  
  934. X      while (!parse_exit) {
  935. X***************
  936. X*** 1138,1207 ****
  937. X  /* target routine is specified by the first substring, other options 
  938. X      are the substrings which follow */
  939. X  
  940. X          if (!strncmp(args[0],"announce",i))
  941. X              announce(Playernum,0,argn,args, 0);
  942. X!          else if (!strncmp(args[0],"allocate",i)) allocateAPs(Playernum,0, argn, args);
  943. X!          else if (!strncmp(args[0],"assault",i)) land(Playernum,1,argn,args,1);
  944. X      else if (!strncmp(args[0], "autoreport",i)) autoreport(Playernum, 0, argn, args);
  945. X!     else if (!strncmp(args[0],"build",i)) build(Playernum,1,argn,args);
  946. X!     else if (!strncmp(args[0], "broadcast", i)) announce(Playernum, 5*(!Race->God), argn, args, 1);
  947. X!     else if (!strncmp(args[0], "block", i)) block(Playernum, 0, argn, args);
  948. X!          else if (!strncmp(args[0],"capitol",i)) capitol(Playernum,50,argn,args);
  949. X!          else if (!strncmp(args[0],"capture",i)) capture(Playernum,1,argn,args);
  950. X      else if (!strncmp(args[0], "center", i)) center(Playernum, 0, argn, args);
  951. X      else if (!strncmp(args[0],"cs",i)) cs(Playernum,0,argn,args);
  952. X!     else if (!strncmp(args[0],"declare",i)) declare(Playernum,1,argn,args);
  953. X!     else if (!strncmp(args[0],"dock",i)) land(Playernum,0,argn,args,0);
  954. X!     else if (!strncmp(args[0],"enslave",i)) enslave(Playernum,2,argn,args);
  955. X!     else if (!strncmp(args[0],"examine",i)) examine(Playernum,0,argn,args);
  956. X!     else if (!strncmp(args[0],"explore",i)) exploration(Playernum,0,argn,args);
  957. X!     else if (!strncmp(args[0],"fire",i)) fire(Playernum,1,argn,args);
  958. X!     else if (!strncmp(args[0], "gag", i)) Dir[Playernum-1].gag = !Dir[Playernum-1].gag;
  959. X!     else if (!strncmp(args[0],"give",i)) give(Playernum,5,argn,args);
  960. X      else if (!strncmp(args[0], "identify", i)) whois(Playernum, 0, argn, args);
  961. X!     else if (!strncmp(args[0], "invite", i)) invite(Playernum, 0, argn, args, 1);
  962. X!     else if (!strncmp(args[0],"land",i)) land(Playernum,1,argn,args,0);
  963. X!     else if (!strncmp(args[0],"launch",i)) launch(Playernum,1,argn,args);
  964. X!     else if (!strncmp(args[0], "list", i) && Race->God) list(Playernum);
  965. X!     else if (!strncmp(args[0],"load",i)) load(Playernum,0,argn,args);
  966. X!     else if (!strncmp(args[0],"map",i)) map(Playernum,0,argn,args);
  967. X!     else if (!strncmp(args[0],"mobilize",i)) mobilize(Playernum,1,argn,args);
  968. X!     else if (!strncmp(args[0],"move",i)) move_popn(Playernum,1,argn,args);
  969. X!     else if (!strncmp(args[0],"make", i)) make_mod(Playernum, 0, argn, args, 0);
  970. X!     else if (!strncmp(args[0],"modify", i)) make_mod(Playernum, 0, argn, args, 1);
  971. X!     else if (!strncmp(args[0],"name",i)) name(Playernum,1*(!Race->God),argn,args);
  972. X!     else if (!strncmp(args[0],"object",i)) rst(Playernum,0,argn,args,4);
  973. X!     else if (!strncmp(args[0],"orbit",i)) orbit(Playernum,0,argn,args);
  974. X!     else if (!strncmp(args[0],"order",i)) order(Playernum,1,argn,args); 
  975. X!     else if (!strncmp(args[0],"page",i)) page(Playernum, 1*(!Race->God), argn, args);
  976. X!          else if (!strncmp(args[0],"colonies",i)) colonies(Playernum,0,argn,args);
  977. X!     else if (!strncmp(args[0], "pledge", i)) pledge(Playernum, 0, argn, args, 1);
  978. X!     else if (!strncmp(args[0],"power",i)) power(Playernum,0,argn,args);
  979. X!     else if (!strncmp(args[0],"profile",i)) profile(Playernum,0,argn,args);
  980. X!     else if (!strncmp(args[0],"relation",i)) relation(Playernum,0,argn,args);
  981. X      else if (!strncmp(args[0],"read",i)) read_messages(Playernum,0,argn,args);
  982. X!     else if (!strncmp(args[0],"reset", i) && Race->God) reload_star_data_base();
  983. X!     else if (!strncmp(args[0],"report",i)) rst(Playernum,0,argn,args,0);
  984. X!     else if (!strncmp(args[0],"@@shutdown",i) && Race->God) {
  985. X          shutdown_flag = 1;
  986. X          notify(Playernum, "Doing shutdown.\n");
  987. X!     } else if (!strncmp(args[0],"stock",i)) rst(Playernum,0,argn,args,1);
  988. X!     else if (!strncmp(args[0],"ship",i)) rst(Playernum,0,argn,args,3);
  989. X!     else if (!strncmp(args[0],"survey",i)) survey(Playernum,0,argn,args);
  990. X!     else if (!strncmp(args[0], "send", i)) send_message(Playernum, 1*(!Race->God), argn, args);
  991. X!     else if (!strncmp(args[0],"scrap",i)) scrap(Playernum,1,argn,args);
  992. X!     else if(!strncmp(args[0],"tactical",i)) rst(Playernum,0,argn,args,2);
  993. X! /*    else if (!strncmp(args[0],"telegram",i)) telegram(Playernum,0,argn,args); */
  994. X!     else if(!strncmp(args[0],"technology",i)) technology(Playernum,1,argn,args);
  995. X      else if (!strncmp(args[0],"toggle",i)) toggle(Playernum,0,argn,args);
  996. X!     else if(!strncmp(args[0],"toxicity",i)) toxicity(Playernum,1,argn,args);
  997. X!     else if (!strncmp(args[0],"transfer",i)) transfer(Playernum,1,argn,args);
  998. X!     else if (!strncmp(args[0],"unload",i)) load(Playernum,0,argn,args);
  999. X!     else if (!strncmp(args[0],"undock",i)) launch(Playernum,0,argn,args);
  1000. X!     else if (!strncmp(args[0], "uninvite", i)) invite(Playernum, 0, argn, args, 0); 
  1001. X!     else if (!strncmp(args[0], "unpledge", i)) pledge(Playernum, 0, argn, args, 0); 
  1002. X!         else if (!strncmp(args[0],"time",i)) GB_time(Playernum);
  1003. X!     else if (!strncmp(args[0],"zoom",i)) zoom(Playernum,0,argn,args);
  1004. X              /* only owning player can use fix */
  1005. X       else {
  1006. X             sprintf(buf,"'%s':illegal command error(%d).\n",args[0],*args[0]);
  1007. X--- 1147,1252 ----
  1008. X  /* target routine is specified by the first substring, other options 
  1009. X      are the substrings which follow */
  1010. X  
  1011. X+ openracedata(&server_racedata);
  1012. X+ getrace(server_racedata, &r, Playernum);
  1013. X+ old = r->daily;
  1014. X+ God = r->God;
  1015. X+ if(!r->standby && r->daily) {
  1016. X+     r->daily = (short)daily_time(r);
  1017. X+     putrace(server_racedata, r);
  1018. X+     }
  1019. X+ close_file(server_racedata);
  1020. X+ 
  1021. X+ ok = ((!r->standby && r->daily) || God);    /* whether or not the player can execture the command */
  1022. X+ 
  1023. X          if (!strncmp(args[0],"announce",i))
  1024. X              announce(Playernum,0,argn,args, 0);
  1025. X!          else if (!strncmp(args[0],"allocate",i) && ok) allocateAPs(Playernum,0, argn, args);
  1026. X!          else if (!strncmp(args[0],"assault",i) && ok) dock(Playernum,1,argn,args,1);
  1027. X      else if (!strncmp(args[0], "autoreport",i)) autoreport(Playernum, 0, argn, args);
  1028. X!     else if (!strncmp(args[0],"build",i) && ok) build(Playernum,1,argn,args);
  1029. X!     else if (!strncmp(args[0], "'", i) || !strncmp(args[0], "broadcast", i)) announce(Playernum, 0, argn, args, 1);
  1030. X!     else if (!strncmp(args[0], "block", i) && ok) block(Playernum, 0, argn, args);
  1031. X!          else if (!strncmp(args[0],"capitol",i) && ok) capitol(Playernum,50,argn,args);
  1032. X!          else if (!strncmp(args[0],"capture",i) && ok) capture(Playernum,1,argn,args);
  1033. X      else if (!strncmp(args[0], "center", i)) center(Playernum, 0, argn, args);
  1034. X      else if (!strncmp(args[0],"cs",i)) cs(Playernum,0,argn,args);
  1035. X!     else if (!strncmp(args[0],"declare",i) && ok) declare(Playernum,1,argn,args);
  1036. X!     else if (!strncmp(args[0],"detonate",i) && ok) detonate(Playernum,0,argn,args);
  1037. X!     else if (!strncmp(args[0],"dismount", i) && ok) mount(Playernum, 0, argn, args, 0);
  1038. X!     else if (!strncmp(args[0], "dissolve", i)) dissolve(Playernum, argn, args);
  1039. X!     else if (!strncmp(args[0],"dock",i) && ok) dock(Playernum,0,argn,args,0);
  1040. X!     else if (!strncmp(args[0],"dump",i) && ok) dump(Playernum,10,argn,args,0);
  1041. X!     else if (!strncmp(args[0],"enslave",i) && ok) enslave(Playernum,2,argn,args);
  1042. X!     else if (!strncmp(args[0],"examine",i) && ok) examine(Playernum,0,argn,args);
  1043. X!     else if (!strncmp(args[0],"explore",i) && ok) exploration(Playernum,0,argn,args);
  1044. X!     else if (!strncmp(args[0],"fire",i) && ok) fire(Playernum,1,argn,args);
  1045. X!     else if (!strncmp(args[0],"give",i) && ok) give(Playernum,5,argn,args);
  1046. X!     else if (!strncmp(args[0], "highlight", i)) highlight(Playernum, 0, argn, args);
  1047. X      else if (!strncmp(args[0], "identify", i)) whois(Playernum, 0, argn, args);
  1048. X!     else if (!strncmp(args[0], "invite", i) && ok) invite(Playernum, 0, argn, args, 1);
  1049. X!     else if (!strncmp(args[0],"land",i) && ok) land(Playernum,1,argn,args);
  1050. X!     else if (!strncmp(args[0],"launch",i) && ok) launch(Playernum,1,argn,args);
  1051. X!     else if (!strncmp(args[0], "list", i) && God) list(Playernum);
  1052. X!     else if (!strncmp(args[0],"load",i) && ok) load(Playernum,0,argn,args, 0);
  1053. X!     else if (!strncmp(args[0],"map",i) && ok) map(Playernum,0,argn,args);
  1054. X!     else if (!strncmp(args[0],"mobilize",i) && ok) mobilize(Playernum,1,argn,args);
  1055. X!     else if (!strncmp(args[0],"move",i) && ok) move_popn(Playernum,1,argn,args);
  1056. X!     else if (!strncmp(args[0],"make", i) && ok) make_mod(Playernum, 0, argn, args, 0);
  1057. X!     else if (!strncmp(args[0],"modify", i) && ok) make_mod(Playernum, 0, argn, args, 1);
  1058. X!     else if (!strncmp(args[0],"mount", i) && ok) mount(Playernum, 0, argn, args, 1);
  1059. X!     else if (!strncmp(args[0],"motto", i) && ok) motto(Playernum, 0, argn, args);
  1060. X!     else if (!strncmp(args[0],"name",i) && ok) name(Playernum, !God,argn,args);
  1061. X!     else if (!strncmp(args[0],"orbit",i) && ok) orbit(Playernum,0,argn,args);
  1062. X!     else if (!strncmp(args[0],"order",i) && ok) order(Playernum,1,argn,args); 
  1063. X!     else if (!strncmp(args[0],"page",i)) page(Playernum, !God, argn, args);
  1064. X!          else if (!strncmp(args[0],"colonies",i) && ok) colonies(Playernum,0,argn,args);
  1065. X!     else if (!strncmp(args[0], "pledge", i) && ok) pledge(Playernum, 0, argn, args, 1);
  1066. X!     else if (!strncmp(args[0],"power",i) && ok) power(Playernum,0,argn,args);
  1067. X!     else if (!strncmp(args[0],"profile",i) && ok) profile(Playernum,0,argn,args);
  1068. X!     else if (!strncmp(args[0],"production", i) && ok) production(Playernum, 0, argn, args);
  1069. X!     else if (!strncmp(args[0],"relation",i) && ok) relation(Playernum,0,argn,args);
  1070. X      else if (!strncmp(args[0],"read",i)) read_messages(Playernum,0,argn,args);
  1071. X!     else if (!strncmp(args[0],"reset", i) && God) {
  1072. X!                 for (j=1; j<=Numraces(); j++)
  1073. X!                 notify(j, "DOING RESET...\n");
  1074. X!                 force_output();
  1075. X!             reload_star_data_base();
  1076. X!             do_reset();
  1077. X!             }
  1078. X!     else if (!strncmp(args[0],"report",i) && ok) rst(Playernum,0,argn,args,0);
  1079. X!     else if (!strncmp(args[0],"repair",i) && ok) repair(Playernum,0,argn,args);
  1080. X!     else if (!strncmp(args[0],"@@shutdown",i) && God) {
  1081. X          shutdown_flag = 1;
  1082. X          notify(Playernum, "Doing shutdown.\n");
  1083. X!     } else if (!strncmp(args[0],"stock",i) && ok) rst(Playernum,0,argn,args,1);
  1084. X!     else if (!strncmp(args[0], "standby", i)) {
  1085. X!         r->standby = !r->standby;
  1086. X!         openracedata(&server_racedata);
  1087. X!         putrace(server_racedata, r);
  1088. X!         close_file(server_racedata);
  1089. X!         if(r->standby) notify(Playernum, "Standing by\n");
  1090. X!         else notify(Playernum, "Returning to active status\n");
  1091. X!     } else if (!strncmp(args[0],"stats",i) && ok) rst(Playernum,0,argn,args,4);
  1092. X!     else if (!strncmp(args[0],"ship",i) && ok) rst(Playernum,0,argn,args,3);
  1093. X!     else if (!strncmp(args[0],"survey",i) && ok) survey(Playernum,0,argn,args);
  1094. X!     else if (!strncmp(args[0], "send", i)) send_message(Playernum, 1*(!God), argn, args);
  1095. X!     else if (!strncmp(args[0],"scrap",i) && ok) scrap(Playernum,1,argn,args);
  1096. X!     else if(!strncmp(args[0],"tactical",i) && ok) rst(Playernum,0,argn,args,2);
  1097. X!     else if(!strncmp(args[0],"technology",i) && ok) technology(Playernum,1,argn,args);
  1098. X      else if (!strncmp(args[0],"toggle",i)) toggle(Playernum,0,argn,args);
  1099. X!     else if(!strncmp(args[0],"toxicity",i) && ok) toxicity(Playernum,1,argn,args);
  1100. X!     else if (!strncmp(args[0],"transfer",i) && ok) transfer(Playernum,1,argn,args);
  1101. X!     else if (!strncmp(args[0],"unload",i) && ok) load(Playernum,0,argn,args, 1);
  1102. X!     else if (!strncmp(args[0],"undock",i) && ok) launch(Playernum,0,argn,args);
  1103. X!     else if (!strncmp(args[0], "uninvite", i) && ok) invite(Playernum, 0, argn, args, 0); 
  1104. X!     else if (!strncmp(args[0], "unpledge", i) && ok) pledge(Playernum, 0, argn, args, 0); 
  1105. X!         else if (!strncmp(args[0],"time",i)) {
  1106. X!             int alloc;
  1107. X!             if(argn > 1) alloc = atoi(args[1]);
  1108. X!             else alloc = 0;
  1109. X!             GB_time(Playernum, r, alloc);
  1110. X!     } else if (!strncmp(args[0],"zoom",i)) zoom(Playernum,0,argn,args);
  1111. X              /* only owning player can use fix */
  1112. X       else {
  1113. X             sprintf(buf,"'%s':illegal command error(%d).\n",args[0],*args[0]);
  1114. X***************
  1115. X*** 1208,1221 ****
  1116. X          notify(Playernum, buf);
  1117. X          }
  1118. X  
  1119. X! /* send the prompt to the player */
  1120. X!     sprintf(buf, "%s", Dir[Playernum-1].prompt);
  1121. X          notify(Playernum, buf);
  1122. X  
  1123. X  }
  1124. X  
  1125. X  void panic(message)
  1126. X! const char *message;
  1127. X  {
  1128. X      FILE *f;
  1129. X      int i;
  1130. X--- 1253,1272 ----
  1131. X          notify(Playernum, buf);
  1132. X          }
  1133. X  
  1134. X! /* compute the prompt and send to the player */
  1135. X! do_prompt(r);
  1136. X! 
  1137. X! if(old && !r->daily)
  1138. X!     notify(Playernum, "You're daily time allocation has run out!!!\n");
  1139. X! 
  1140. X! free(r);
  1141. X! sprintf(buf, "%s", Dir[Playernum-1].prompt);
  1142. X          notify(Playernum, buf);
  1143. X  
  1144. X  }
  1145. X  
  1146. X  void panic(message)
  1147. X! char *message;
  1148. X  {
  1149. X      FILE *f;
  1150. X      int i;
  1151. X***************
  1152. X*** 1261,1273 ****
  1153. X      strcat(s1, s2);
  1154. X  }
  1155. X  
  1156. X! GB_time(Playernum) /* report back the update status */
  1157. X  int Playernum;
  1158. X  {
  1159. X- #ifdef BSD4_2
  1160. X      char zone[16];
  1161. X- #endif
  1162. X  
  1163. X      clk = time(0);
  1164. X      current_tm=localtime(&clk);
  1165. X  #ifdef BSD4_2
  1166. X--- 1312,1325 ----
  1167. X      strcat(s1, s2);
  1168. X  }
  1169. X  
  1170. X! GB_time(Playernum, r, alloc) /* report back the update status */
  1171. X  int Playernum;
  1172. X+ racetype *r;
  1173. X+ int alloc;
  1174. X  {
  1175. X      char zone[16];
  1176. X  
  1177. X+     if(!alloc) {
  1178. X      clk = time(0);
  1179. X      current_tm=localtime(&clk);
  1180. X  #ifdef BSD4_2
  1181. X***************
  1182. X*** 1286,1291 ****
  1183. X--- 1338,1359 ----
  1184. X     notify(Playernum, "No updates since the server was started.\n");
  1185. X      /* can happen if you have just started the game up */   
  1186. X  notify(Playernum, start_buf);
  1187. X+ 
  1188. X+ sprintf(buf, "%d/%d weekly/daily minutes of active time remaining.\n", r->weekly/60, r->daily/60);
  1189. X+ notify(Playernum, buf);
  1190. X+     } else if(alloc  > 0) {
  1191. X+         printf("%d\n", alloc);
  1192. X+         alloc = MIN(MIN(alloc*60, r->weekly), DAILY*60 - r->daily)/60;
  1193. X+         r->weekly -= alloc*60;
  1194. X+         r->daily += alloc*60;
  1195. X+         sprintf(buf, "%d minutes of weekly allotment allocated.\n", alloc);
  1196. X+         notify(Playernum, buf);
  1197. X+     openracedata(&server_racedata);
  1198. X+     putrace(server_racedata, r);
  1199. X+     close_file(server_racedata);
  1200. X+     } else {
  1201. X+         notify(Playernum, "You can only allocate a positive number of minutes.\n");
  1202. X+     }
  1203. X  }
  1204. X  
  1205. X  help(e, argn,args)
  1206. X***************
  1207. X*** 1299,1327 ****
  1208. X      sprintf(buf,"usage: help [topic]\n");
  1209. X          queue_string(e, buf);
  1210. X      sprintf(buf,"    valid topics are:\n  CONCEPTS:\n%s",
  1211. X!         "help     scope    actionpoints       explore    colony\n" );
  1212. X          queue_string(e, buf);
  1213. X!     sprintf(buf,"daemon   races     blocks     quit           info\n");
  1214. X          queue_string(e, buf);
  1215. X      sprintf(buf,"\n  COMMANDS:\n");
  1216. X          queue_string(e, buf);
  1217. X!     sprintf(buf,"cs       map      survey  orbit      zoom     autoreport\n");
  1218. X          queue_string(e, buf);
  1219. X      sprintf(buf,"toggle   gag      capitol  allocate\n\n");
  1220. X          queue_string(e, buf);
  1221. X!     sprintf(buf, "announce page    who    time    quit\n");
  1222. X          queue_string(e, buf);
  1223. X!     sprintf(buf,"build    ship     stock   report     tactical  order     examine\n");
  1224. X          queue_string(e, buf);
  1225. X      sprintf(buf,"land     launch   dock    undock     load      assault   scrap\n\n");
  1226. X          queue_string(e, buf);
  1227. X!     sprintf(buf,"assault  capture  fire    give       move       enslave\n\n");
  1228. X          queue_string(e, buf);
  1229. X!     sprintf(buf,"declare  profile  relation    power   explore\n");
  1230. X          queue_string(e, buf);
  1231. X!     sprintf(buf,"colonies name     mobilize technology toxicity   transfer\n");
  1232. X          queue_string(e, buf);
  1233. X!     sprintf(buf, "make   modify\n");
  1234. X          queue_string(e, buf); 
  1235. X  
  1236. X   } else {
  1237. X--- 1367,1395 ----
  1238. X      sprintf(buf,"usage: help [topic]\n");
  1239. X          queue_string(e, buf);
  1240. X      sprintf(buf,"    valid topics are:\n  CONCEPTS:\n%s",
  1241. X!         "beginner\nhelp     scope    actionpoints       explore    colony\n" );
  1242. X          queue_string(e, buf);
  1243. X!     sprintf(buf,"daemon   races     blocks     quit      crystal     lasers    info\n");
  1244. X          queue_string(e, buf);
  1245. X      sprintf(buf,"\n  COMMANDS:\n");
  1246. X          queue_string(e, buf);
  1247. X!     sprintf(buf,"cs       map      survey  orbit      zoom     autoreport    production\n");
  1248. X          queue_string(e, buf);
  1249. X      sprintf(buf,"toggle   gag      capitol  allocate\n\n");
  1250. X          queue_string(e, buf);
  1251. X!     sprintf(buf, "announce page    who    time    standby    quit\n");
  1252. X          queue_string(e, buf);
  1253. X!     sprintf(buf,"build    ship     stock   report     tactical  stats order     examine\n");
  1254. X          queue_string(e, buf);
  1255. X      sprintf(buf,"land     launch   dock    undock     load      assault   scrap\n\n");
  1256. X          queue_string(e, buf);
  1257. X!     sprintf(buf,"assault  capture  fire    give       move       enslave    repair\n\n");
  1258. X          queue_string(e, buf);
  1259. X!     sprintf(buf,"declare  profile  relation    power   explore     detonate\n");
  1260. X          queue_string(e, buf);
  1261. X!     sprintf(buf,"colonies dump  name motto    mobilize technology toxicity   transfer\n");
  1262. X          queue_string(e, buf);
  1263. X!     sprintf(buf, "make   modify    mount\n");
  1264. X          queue_string(e, buf); 
  1265. X  
  1266. X   } else {
  1267. X***************
  1268. X*** 1356,1358 ****
  1269. X--- 1424,1513 ----
  1270. X  if(sbuf.st_size)
  1271. X  notify(Playernum, "You have telegram(s) waiting. Use 'read' to read them.\n");
  1272. X  }
  1273. X+ 
  1274. X+ kill_ship(Playernum, ship)
  1275. X+ int Playernum;
  1276. X+ shiptype *ship;
  1277. X+ {
  1278. X+ racetype *r;
  1279. X+ shiptype *s;
  1280. X+ int kill_racedata, kill_shdata, sh;
  1281. X+ 
  1282. X+ ship->is_alive = 0;
  1283. X+ ship->popn = 0;
  1284. X+ ship->damage = 100; 
  1285. X+ ship->notified = 0;
  1286. X+ if(ship->type==OTYPE_GOV) {
  1287. X+         openracedata(&kill_racedata);
  1288. X+         getrace(kill_racedata, &r, (int)ship->owner);
  1289. X+         r->Gov_ship = 0;
  1290. X+         putrace(kill_racedata, r);
  1291. X+         close_file(kill_racedata);
  1292. X+         free(r);
  1293. X+                 }
  1294. X+ 
  1295. X+ /* undock the stuff docked with it */
  1296. X+ if(ship->is_docked && ship->whatdest==LEVEL_SHIP) {
  1297. X+     openshdata(&kill_shdata);
  1298. X+     getship(kill_shdata, &s, ship->destshipno);
  1299. X+     s->is_docked = 0;
  1300. X+     s->whatdest = LEVEL_UNIV;
  1301. X+     putship(kill_shdata, s, ship->destshipno);
  1302. X+     free(s);
  1303. X+ }
  1304. X+ /* fighters are destroyed if one board a carrier */
  1305. X+ if(ship->type==STYPE_CARRIER) {
  1306. X+     sh=ship->object.number;
  1307. X+     openshdata(&kill_shdata);
  1308. X+     while(sh) {
  1309. X+     (void)getship(kill_shdata, &s, sh);
  1310. X+     s->is_alive = 0; s->notified = 0;
  1311. X+     putship(kill_shdata, s, sh);    
  1312. X+     sh = s->object.number;
  1313. X+     free(s);
  1314. X+     }
  1315. X+     close_file(kill_shdata);
  1316. X+ }
  1317. X+ 
  1318. X+ /* if the ship is a VN, keep track of who killed it */
  1319. X+     if(ship->type==OTYPE_VN) {
  1320. X+         ship->object.number3 = Playernum; /* remember who killed it */
  1321. X+     }
  1322. X+ }
  1323. X+ 
  1324. X+ compute_power_blocks()
  1325. X+ {
  1326. X+ int i, j, dummy;
  1327. X+ Num_races = Numraces();
  1328. X+ /* compute alliance block power */
  1329. X+ sprintf(Power_blocks.time, "%2d/%2d/%d %02d:%02d:%02d %s", 
  1330. X+     current_tm->tm_mon+1, current_tm->tm_mday,
  1331. X+     current_tm->tm_year, current_tm->tm_hour,
  1332. X+     current_tm->tm_min, current_tm->tm_sec, current_tm->tm_zone);
  1333. X+  for (i=1; i<=Num_races; i++) {
  1334. X+     dummy=(Blocks[i-1].invite & Blocks[i-1].pledge);
  1335. X+                 Power_blocks.members[i-1] = 0;
  1336. X+                 Power_blocks.sectors_owned[i-1] = 0;
  1337. X+                 Power_blocks.popn[i-1] = 0;
  1338. X+                 Power_blocks.ships_owned[i-1] = 0;
  1339. X+                 Power_blocks.resource[i-1] = 0;
  1340. X+                 Power_blocks.fuel[i-1] = 0;
  1341. X+                 Power_blocks.destruct[i-1] = 0;
  1342. X+                 Power_blocks.systems_owned[i-1] = Blocks[i-1].systems_owned;
  1343. X+                 Power_blocks.VPs[i-1] = Blocks[i-1].VPs;
  1344. X+     for(j=1; j<=Num_races; j++) 
  1345. X+             if(isset(dummy, j)){
  1346. X+                 Power_blocks.members[i-1] += 1;
  1347. X+                 Power_blocks.sectors_owned[i-1] += Power[j-1].sectors_owned;
  1348. X+                 Power_blocks.popn[i-1] += Power[j-1].popn;
  1349. X+                 Power_blocks.ships_owned[i-1] += Power[j-1].ships_owned;
  1350. X+                 Power_blocks.resource[i-1] += Power[j-1].resource;
  1351. X+                 Power_blocks.fuel[i-1] += Power[j-1].fuel;
  1352. X+                 Power_blocks.destruct[i-1] += Power[j-1].destruct;
  1353. X+             }
  1354. X+     }
  1355. X+ 
  1356. X+ 
  1357. X+ }
  1358. X+ 
  1359. X+ 
  1360. X*** /usr/cna/billr/games/gb3/server/doplanet.c    Wed May 30 15:13:01 1990
  1361. X--- server/doplanet.c    Thu Aug 23 16:54:48 1990
  1362. X***************
  1363. X*** 71,76 ****
  1364. X--- 71,77 ----
  1365. X  int oldplanetpopn, oldplanetmaxpopn;
  1366. X  boolean allmod=0,allexp=0;
  1367. X  char buf[200]; 
  1368. X+ float tech_prod();
  1369. X  
  1370. X  Sectormappos = planet->sectormappos;
  1371. X  check(planet,0);
  1372. X***************
  1373. X*** 78,84 ****
  1374. X      return 0;    /* no one's here now */
  1375. X  
  1376. X  if (Stinfo[starnum][planetnum].inhab) {
  1377. X- /*    printf(" getting sectmap pos %d\n",planet->sectormappos); */
  1378. X      opensectdata(§data);
  1379. X      getsmap(sectdata,Smap,planet);
  1380. X      close_file(sectdata);
  1381. X--- 79,84 ----
  1382. X***************
  1383. X*** 87,94 ****
  1384. X      bzero((char *)Sectinfo, sizeof(Sectinfo) );
  1385. X  }
  1386. X  
  1387. X- 
  1388. X- 
  1389. X  check(planet,1);
  1390. X    shipno = planet->ships;
  1391. X  
  1392. X--- 87,92 ----
  1393. X***************
  1394. X*** 147,163 ****
  1395. X             {
  1396. X              sectortype *s;
  1397. X              s = &Sector(*planet,(int)ship->xpos,(int)ship->ypos);
  1398. X!             if (s->des != DES_GAS && 
  1399. X              (int_rand(1,100) <= (((100-ship->damage) * 
  1400. X                    ship->popn)/Max_crew(ship)))) {
  1401. X                /* gas sectors can't be terraformed. */
  1402. X               s->des = races[ship->owner-1]->likesbest;
  1403. X!              s->eff *= 0.5;
  1404. X!              s->mobilization *= 0.5;
  1405. X!              s->resource *= 0.7;
  1406. X!              /*s->popn *= 0.5;*/    /* ?? not sure bout this */
  1407. X              s->popn = 0;
  1408. X!             s->owner = 0;/* i AM sure about this :) */
  1409. X               ship->fuel -= (float)FUEL_COST_TERRA;
  1410. X               ship->mass -= FUEL_COST_TERRA*MASS_FUEL;
  1411. X              if (planet->conditions[TOXIC]<100)
  1412. X--- 145,160 ----
  1413. X             {
  1414. X              sectortype *s;
  1415. X              s = &Sector(*planet,(int)ship->xpos,(int)ship->ypos);
  1416. X!             if (s->des !=races[ship->owner-1]->likesbest &&
  1417. X!             s->des != DES_GAS && 
  1418. X              (int_rand(1,100) <= (((100-ship->damage) * 
  1419. X                    ship->popn)/Max_crew(ship)))) {
  1420. X                /* gas sectors can't be terraformed. */
  1421. X               s->des = races[ship->owner-1]->likesbest;
  1422. X!              s->eff = 0;
  1423. X!              s->mobilization = 0.;
  1424. X              s->popn = 0;
  1425. X!             s->owner = 0;
  1426. X               ship->fuel -= (float)FUEL_COST_TERRA;
  1427. X               ship->mass -= FUEL_COST_TERRA*MASS_FUEL;
  1428. X              if (planet->conditions[TOXIC]<100)
  1429. X***************
  1430. X*** 201,208 ****
  1431. X  check(planet,2);
  1432. X    }
  1433. X  
  1434. X! 
  1435. X!  if (!Stinfo[starnum][planetnum].inhab && 
  1436. X       !Stinfo[starnum][planetnum].Thing_add)
  1437. X      return 0;    /* (no one's explored the planet) */
  1438. X  
  1439. X--- 198,204 ----
  1440. X  check(planet,2);
  1441. X    }
  1442. X  
  1443. X! if (!Stinfo[starnum][planetnum].inhab && 
  1444. X       !Stinfo[starnum][planetnum].Thing_add)
  1445. X      return 0;    /* (no one's explored the planet) */
  1446. X  
  1447. X***************
  1448. X*** 253,258 ****
  1449. X--- 249,255 ----
  1450. X  bzero((char *)prod_res, sizeof(prod_res) );
  1451. X  bzero((char *)prod_fuel, sizeof(prod_fuel) );
  1452. X  bzero((char *)prod_destruct, sizeof(prod_destruct) );
  1453. X+ bzero((char *)prod_crystals, sizeof(prod_crystals) );
  1454. X  
  1455. X  tot_resdep = prod_eff= prod_mob = tot_captured = 0;
  1456. X  Claims = 0;
  1457. X***************
  1458. X*** 267,272 ****
  1459. X--- 264,270 ----
  1460. X  for (i=1; i<=Num_races; i++) {
  1461. X      Compat[i-1] = compatibility(planet, races[i-1]);
  1462. X      planet->info[i-1].numsectsowned = 0;
  1463. X+     planet->info[i-1].popn = 0;
  1464. X      populations[i-1] = 0;
  1465. X      prod_fuel[i-1] = 0;
  1466. X      prod_destruct[i-1] = 0;
  1467. X***************
  1468. X*** 275,285 ****
  1469. X  }
  1470. X  
  1471. X  Getxysect(planet, &x, &y, 1);
  1472. X- /*printf(" while %d\n",Getxysect(planet, &x, &y, 1));    /* reset */
  1473. X  
  1474. X- check(planet,4);
  1475. X  while (Getxysect(planet, &x, &y, 0)) {
  1476. X         p = &Sector(*planet,x,y);
  1477. X       if (p->owner) {
  1478. X          /* (all modified; sectors belonging to that player modified) */
  1479. X          allmod = 1;    
  1480. X--- 273,282 ----
  1481. X  }
  1482. X  
  1483. X  Getxysect(planet, &x, &y, 1);
  1484. X  
  1485. X  while (Getxysect(planet, &x, &y, 0)) {
  1486. X         p = &Sector(*planet,x,y);
  1487. X+ 
  1488. X       if (p->owner) {
  1489. X          /* (all modified; sectors belonging to that player modified) */
  1490. X          allmod = 1;    
  1491. X***************
  1492. X*** 304,310 ****
  1493. X  
  1494. X            Sectinfo[x][y].done = 1;
  1495. X  
  1496. X!       }
  1497. X  
  1498. X  
  1499. X             if (p->owner) {
  1500. X--- 301,308 ----
  1501. X  
  1502. X            Sectinfo[x][y].done = 1;
  1503. X  
  1504. X!       } else
  1505. X!         p->popn = 0;
  1506. X  
  1507. X  
  1508. X             if (p->owner) {
  1509. X***************
  1510. X*** 355,363 ****
  1511. X      }
  1512. X       }
  1513. X  
  1514. X! }
  1515. X! check(planet,5);
  1516. X  
  1517. X  if (allmod) {    /* ( >= 1 inhabited sector on the planet) */
  1518. X  
  1519. X  check(planet,51);
  1520. X--- 353,363 ----
  1521. X      }
  1522. X       }
  1523. X  
  1524. X!    }
  1525. X  
  1526. X+ 
  1527. X+ check(planet,5);
  1528. X+ allmod=1;
  1529. X  if (allmod) {    /* ( >= 1 inhabited sector on the planet) */
  1530. X  
  1531. X  check(planet,51);
  1532. X***************
  1533. X*** 426,437 ****
  1534. X          Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
  1535. X            sprintf(buf," \nWAR STATUS: %d sectors gained, %d sectors lost.\n", sects_gained[i-1],sects_lost[i-1]);
  1536. X      str_cat(telegram_buf, buf);
  1537. X!     push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
  1538. X        }
  1539. X  
  1540. X!     for (i=1; i<=Num_races; i++)
  1541. X       if (planet->info[i-1].autorep) {
  1542. X- 
  1543. X  check(planet,8);
  1544. X  /*      planet->info[i-1].autorep = planet->info[i-1].autorep - 1; */
  1545. X  check(planet,85);
  1546. X--- 426,439 ----
  1547. X          Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
  1548. X            sprintf(buf," \nWAR STATUS: %d sectors gained, %d sectors lost.\n", sects_gained[i-1],sects_lost[i-1]);
  1549. X      str_cat(telegram_buf, buf);
  1550. X!     push_message(TELEG_PLAYER_AUTO, i, telegram_buf, COMBAT);
  1551. X        }
  1552. X  
  1553. X!     for (i=1; i<=Num_races; i++) {
  1554. X!         planet->info[i-1].prod_res = prod_res[i-1];
  1555. X!         planet->info[i-1].prod_fuel = prod_fuel[i-1];
  1556. X!         planet->info[i-1].prod_dest = prod_destruct[i-1];
  1557. X       if (planet->info[i-1].autorep) {
  1558. X  check(planet,8);
  1559. X  /*      planet->info[i-1].autorep = planet->info[i-1].autorep - 1; */
  1560. X  check(planet,85);
  1561. X***************
  1562. X*** 445,450 ****
  1563. X--- 447,456 ----
  1564. X        sprintf(buf, "Total      Prod: %dr %df %dd\n", prod_res[i-1], prod_fuel[i-1],
  1565. X              prod_destruct[i-1]);
  1566. X      str_cat(telegram_buf, buf);
  1567. X+     if(prod_crystals[i-1]) {
  1568. X+         sprintf(buf, "    %d crystals found\n", prod_crystals[i-1]);
  1569. X+         str_cat(telegram_buf, buf);
  1570. X+             }
  1571. X  
  1572. X      if(tot_captured) {
  1573. X        sprintf(buf,"%d sectors captured\n", tot_captured);
  1574. X***************
  1575. X*** 468,476 ****
  1576. X          str_cat(telegram_buf, buf);
  1577. X        }
  1578. X  
  1579. X!  push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
  1580. X  
  1581. X      }
  1582. X  check(planet,9);
  1583. X  
  1584. X         /* find out who is on this planet, for nova notification */
  1585. X--- 474,483 ----
  1586. X          str_cat(telegram_buf, buf);
  1587. X        }
  1588. X  
  1589. X!  push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
  1590. X  
  1591. X      }
  1592. X+ }
  1593. X  check(planet,9);
  1594. X  
  1595. X         /* find out who is on this planet, for nova notification */
  1596. X***************
  1597. X*** 486,492 ****
  1598. X          str_cat(telegram_buf, buf);
  1599. X                for (i=1; i<=Num_races; i++)
  1600. X          if (planet->info[i-1].numsectsowned) {
  1601. X!         push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
  1602. X          }
  1603. X       }
  1604. X  
  1605. X--- 493,499 ----
  1606. X          str_cat(telegram_buf, buf);
  1607. X                for (i=1; i<=Num_races; i++)
  1608. X          if (planet->info[i-1].numsectsowned) {
  1609. X!         push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
  1610. X          }
  1611. X       }
  1612. X  
  1613. X***************
  1614. X*** 498,504 ****
  1615. X      this requires that you be the only one inhabiting the planet */
  1616. X  
  1617. X      if (planet->info[i-1].numsectsowned > 0) {
  1618. X!         int aliensects=0,stolenres=0,stolendes=0,stolenfuel=0;
  1619. X          int stuff=0;
  1620. X  
  1621. X  
  1622. X--- 505,512 ----
  1623. X      this requires that you be the only one inhabiting the planet */
  1624. X  
  1625. X      if (planet->info[i-1].numsectsowned > 0) {
  1626. X!         int aliensects=0;
  1627. X!         int stolenres=0,stolendes=0,stolenfuel=0, stolencrystals=0;
  1628. X          int stuff=0;
  1629. X  
  1630. X  
  1631. X***************
  1632. X*** 508,514 ****
  1633. X              aliensects += planet->info[j-1].numsectsowned;
  1634. X              if(planet->info[j-1].resource >0 ||
  1635. X                 planet->info[j-1].destruct >0 ||
  1636. X!                planet->info[j-1].fuel > 0.0) stuff=1;
  1637. X              }
  1638. X  
  1639. X          if(!aliensects && stuff)
  1640. X--- 516,523 ----
  1641. X              aliensects += planet->info[j-1].numsectsowned;
  1642. X              if(planet->info[j-1].resource >0 ||
  1643. X                 planet->info[j-1].destruct >0 ||
  1644. X!                planet->info[j-1].fuel > 0.0 ||
  1645. X!                planet->info[j-1].crystals) stuff=1;
  1646. X              }
  1647. X  
  1648. X          if(!aliensects && stuff)
  1649. X***************
  1650. X*** 519,537 ****
  1651. X                stolenres += planet->info[j-1].resource;
  1652. X                stolendes += planet->info[j-1].destruct;
  1653. X                stolenfuel += planet->info[j-1].fuel;
  1654. X                planet->info[j-1].resource = 0;
  1655. X                planet->info[j-1].destruct = 0;
  1656. X                planet->info[j-1].fuel = 0;
  1657. X!             }
  1658. X          planet->info[i-1].resource += stolenres;
  1659. X          planet->info[i-1].destruct += stolendes;
  1660. X          planet->info[i-1].fuel += stolenfuel;
  1661. X! /* notify player of recovered stockpiles */
  1662. X        sprintf(telegram_buf,"****** Report: Planet /%s/%s ******\n\n", 
  1663. X          Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
  1664. X!       sprintf(buf," %d resources \n %d destruct \n %d fuel recovered from alien stock piles",stolenres,stolendes,stolenfuel);
  1665. X      str_cat(telegram_buf, buf);
  1666. X!     push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
  1667. X              } /*aliensect==0*/
  1668. X          }
  1669. X  
  1670. X--- 528,549 ----
  1671. X                stolenres += planet->info[j-1].resource;
  1672. X                stolendes += planet->info[j-1].destruct;
  1673. X                stolenfuel += planet->info[j-1].fuel;
  1674. X+               stolencrystals += planet->info[j-1].crystals;
  1675. X                planet->info[j-1].resource = 0;
  1676. X                planet->info[j-1].destruct = 0;
  1677. X                planet->info[j-1].fuel = 0;
  1678. X!               planet->info[j-1].crystals = 0;
  1679. X!               }
  1680. X          planet->info[i-1].resource += stolenres;
  1681. X          planet->info[i-1].destruct += stolendes;
  1682. X          planet->info[i-1].fuel += stolenfuel;
  1683. X!         planet->info[i-1].crystals += stolencrystals;
  1684. X!         /* notify player of recovered stockpiles */
  1685. X        sprintf(telegram_buf,"****** Report: Planet /%s/%s ******\n\n", 
  1686. X          Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
  1687. X!       sprintf(buf," %d resources \n %d destruct \n %d fuel\n %d crystals recovered from alien stock piles",stolenres,stolendes,stolenfuel,stolencrystals);
  1688. X      str_cat(telegram_buf, buf);
  1689. X!     push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
  1690. X              } /*aliensect==0*/
  1691. X          }
  1692. X  
  1693. X***************
  1694. X*** 558,564 ****
  1695. X      else if (planet->conditions[TOXIC] < 0)
  1696. X         planet->conditions[TOXIC] = 0;
  1697. X  
  1698. X!     /* deal with enslaved planets */
  1699. X     if (planet->slaved_to) {
  1700. X      if (populations[planet->slaved_to-1] >= planet->popn * 0.001 ||
  1701. X          (Stinfo[starnum][planetnum].intimidated && random()&01) ) {
  1702. X--- 570,583 ----
  1703. X      else if (planet->conditions[TOXIC] < 0)
  1704. X         planet->conditions[TOXIC] = 0;
  1705. X  
  1706. X! Getxysect(planet, &x, &y, 1);
  1707. X! while (Getxysect(planet, &x, &y, 0)) {
  1708. X!        p = &Sector(*planet,x,y);
  1709. X!      if (p->owner)
  1710. X!          planet->info[p->owner-1].popn += p->popn;
  1711. X!  }
  1712. X! 
  1713. X! /* deal with enslaved planets */
  1714. X     if (planet->slaved_to) {
  1715. X      if (populations[planet->slaved_to-1] >= planet->popn * 0.001 ||
  1716. X          (Stinfo[starnum][planetnum].intimidated && random()&01) ) {
  1717. X***************
  1718. X*** 601,607 ****
  1719. X                  p->is_wasted = 1;
  1720. X                 }
  1721. X              }
  1722. X!         }
  1723. X          sprintf(telegram_buf,"NOTICE from planet /%s/%s!\n",
  1724. X                  Stars[starnum]->name,
  1725. X                  Stars[starnum]->pnames[planetnum]);
  1726. X--- 620,629 ----
  1727. X                  p->is_wasted = 1;
  1728. X                 }
  1729. X              }
  1730. X! 
  1731. X! /* also add up the populations while here */
  1732. X!             
  1733. X!             }
  1734. X          sprintf(telegram_buf,"NOTICE from planet /%s/%s!\n",
  1735. X                  Stars[starnum]->name,
  1736. X                  Stars[starnum]->pnames[planetnum]);
  1737. X***************
  1738. X*** 613,622 ****
  1739. X              str_cat(telegram_buf, buf);
  1740. X          for (i=1; i<=Num_races; i++)
  1741. X            if (planet->info[i-1].numsectsowned && i!=planet->slaved_to) {
  1742. X!             push_message(TELEG_PLAYER_AUTO, i, telegram_buf);
  1743. X              }
  1744. X           /* send to previous slave holder */
  1745. X!     push_message(TELEG_PLAYER_AUTO, planet->slaved_to, telegram_buf);
  1746. X  
  1747. X          planet->slaved_to = 0;
  1748. X          planet->is_sheep = 0;
  1749. X--- 635,644 ----
  1750. X              str_cat(telegram_buf, buf);
  1751. X          for (i=1; i<=Num_races; i++)
  1752. X            if (planet->info[i-1].numsectsowned && i!=planet->slaved_to) {
  1753. X!             push_message(TELEG_PLAYER_AUTO, i, telegram_buf, TELEGRAM);
  1754. X              }
  1755. X           /* send to previous slave holder */
  1756. X!     push_message(TELEG_PLAYER_AUTO, planet->slaved_to, telegram_buf, TELEGRAM);
  1757. X  
  1758. X          planet->slaved_to = 0;
  1759. X          planet->is_sheep = 0;
  1760. X***************
  1761. X*** 628,654 ****
  1762. X  
  1763. X        if (planet->info[i-1].numsectsowned) {
  1764. X  
  1765. X!          if (planet->info[i-1].fuel + prod_fuel[i-1] > 100000)
  1766. X!           planet->info[i-1].fuel = 100000;
  1767. X          else
  1768. X            planet->info[i-1].fuel += prod_fuel[i-1];
  1769. X  
  1770. X!          if (planet->info[i-1].resource + prod_res[i-1] > 100000)
  1771. X!           planet->info[i-1].resource = 100000;
  1772. X          else
  1773. X            planet->info[i-1].resource += prod_res[i-1];
  1774. X  
  1775. X!          if (planet->info[i-1].destruct + prod_destruct[i-1] > 100000)
  1776. X!           planet->info[i-1].destruct = 100000;
  1777. X          else
  1778. X            planet->info[i-1].destruct += prod_destruct[i-1];
  1779. X  
  1780. X!         /* do tech investments */
  1781. X         if (planet->info[i-1].resource >= planet->info[i-1].tech_invest) {
  1782. X!          races[i-1]->tech += 
  1783. X!             log10(1.0+(double)planet->info[i-1].tech_invest) * TECH_INVEST;
  1784. X           planet->info[i-1].resource -= planet->info[i-1].tech_invest;
  1785. X!        }
  1786. X  
  1787. X         /* build wc's if it's been ordered */
  1788. X        if (planet->info[i-1].tox_thresh>0 &&
  1789. X--- 650,684 ----
  1790. X  
  1791. X        if (planet->info[i-1].numsectsowned) {
  1792. X  
  1793. X!          if (planet->info[i-1].fuel + prod_fuel[i-1] > 65567)
  1794. X!           planet->info[i-1].fuel = 65567;
  1795. X          else
  1796. X            planet->info[i-1].fuel += prod_fuel[i-1];
  1797. X  
  1798. X!          if (planet->info[i-1].resource + prod_res[i-1] > 65567)
  1799. X!           planet->info[i-1].resource = 65567;
  1800. X          else
  1801. X            planet->info[i-1].resource += prod_res[i-1];
  1802. X  
  1803. X!          if (planet->info[i-1].destruct + prod_destruct[i-1] > 65567)
  1804. X!           planet->info[i-1].destruct = 65567;
  1805. X          else
  1806. X            planet->info[i-1].destruct += prod_destruct[i-1];
  1807. X  
  1808. X!         if (planet->info[i-1].crystals + prod_crystals[i-1] > 127)
  1809. X!           planet->info[i-1].crystals = 127;
  1810. X!         else
  1811. X!           planet->info[i-1].crystals += prod_crystals[i-1];
  1812. X! 
  1813. X!         /* do tech investments */
  1814. X         if (planet->info[i-1].resource >= planet->info[i-1].tech_invest) {
  1815. X!           planet->info[i-1].prod_tech =
  1816. X!           tech_prod((int)planet->info[i-1].tech_invest,
  1817. X!                   (int)planet->info[i-1].popn);
  1818. X           planet->info[i-1].resource -= planet->info[i-1].tech_invest;
  1819. X!          races[i-1]->tech += planet->info[i-1].prod_tech;
  1820. X!        } else
  1821. X!           planet->info[i-1].prod_tech;
  1822. X  
  1823. X         /* build wc's if it's been ordered */
  1824. X        if (planet->info[i-1].tox_thresh>0 &&
  1825. X***************
  1826. X*** 665,679 ****
  1827. X  
  1828. X          s2->armor = Shipdata[OTYPE_TOXWC][ABIL_ARMOR];
  1829. X          s2->guns = Shipdata[OTYPE_TOXWC][ABIL_GUNS];
  1830. X-         s2->size = Shipdata[OTYPE_TOXWC][ABIL_TARGET];
  1831. X          s2->max_crew = Shipdata[OTYPE_TOXWC][ABIL_MAXCREW];
  1832. X          s2->max_resource = Shipdata[OTYPE_TOXWC][ABIL_CARGO];
  1833. X          s2->max_fuel = Shipdata[OTYPE_TOXWC][ABIL_FUELCAP];
  1834. X          s2->max_destruct = Shipdata[OTYPE_TOXWC][ABIL_DESTCAP];
  1835. X          s2->max_speed = Shipdata[OTYPE_TOXWC][ABIL_SPEED];
  1836. X!         s2->base_mass = getmass(s2);
  1837. X          s2->mass = s2->base_mass;
  1838. X           s2->is_alive = 1;
  1839. X          sprintf(s2->name,"Scum%04d",Num_ships);
  1840. X  
  1841. X          insert_sh_plan(planet,s2,Num_ships);
  1842. X--- 695,711 ----
  1843. X  
  1844. X          s2->armor = Shipdata[OTYPE_TOXWC][ABIL_ARMOR];
  1845. X          s2->guns = Shipdata[OTYPE_TOXWC][ABIL_GUNS];
  1846. X          s2->max_crew = Shipdata[OTYPE_TOXWC][ABIL_MAXCREW];
  1847. X          s2->max_resource = Shipdata[OTYPE_TOXWC][ABIL_CARGO];
  1848. X          s2->max_fuel = Shipdata[OTYPE_TOXWC][ABIL_FUELCAP];
  1849. X          s2->max_destruct = Shipdata[OTYPE_TOXWC][ABIL_DESTCAP];
  1850. X          s2->max_speed = Shipdata[OTYPE_TOXWC][ABIL_SPEED];
  1851. X!         s2->build_cost = Shipdata[OTYPE_TOXWC][ABIL_COST];
  1852. X!         s2->size = ship_size(s2);
  1853. X!          s2->base_mass = 1.0; /* a hack */
  1854. X          s2->mass = s2->base_mass;
  1855. X           s2->is_alive = 1;
  1856. X+         s2->active = 1;
  1857. X          sprintf(s2->name,"Scum%04d",Num_ships);
  1858. X  
  1859. X          insert_sh_plan(planet,s2,Num_ships);
  1860. X***************
  1861. X*** 707,714 ****
  1862. X      Power[i-1].resource += planet->info[i-1].resource;
  1863. X      Power[i-1].destruct += planet->info[i-1].destruct;
  1864. X      Power[i-1].fuel += planet->info[i-1].fuel;
  1865. X-     Power[i-1].planets_owned += !!planet->info[i-1].numsectsowned;
  1866. X      Power[i-1].sectors_owned += planet->info[i-1].numsectsowned;
  1867. X  /*    Power[i-1].sum_mob += avg_mob[i-1]; */
  1868. X   }
  1869. X  
  1870. X--- 739,746 ----
  1871. X      Power[i-1].resource += planet->info[i-1].resource;
  1872. X      Power[i-1].destruct += planet->info[i-1].destruct;
  1873. X      Power[i-1].fuel += planet->info[i-1].fuel;
  1874. X      Power[i-1].sectors_owned += planet->info[i-1].numsectsowned;
  1875. X+     Power[i-1].planets_owned += !!planet->info[i-1].numsectsowned;
  1876. X  /*    Power[i-1].sum_mob += avg_mob[i-1]; */
  1877. X   }
  1878. X  
  1879. END_OF_FILE
  1880. if test 54235 -ne `wc -c <'patches02a'`; then
  1881.     echo shar: \"'patches02a'\" unpacked with wrong size!
  1882. fi
  1883. # end of 'patches02a'
  1884. echo shar: End of archive 4 \(of 9\).
  1885. cp /dev/null ark4isdone
  1886. MISSING=""
  1887. for I in 1 2 3 4 5 6 7 8 9 ; do
  1888.     if test ! -f ark${I}isdone ; then
  1889.     MISSING="${MISSING} ${I}"
  1890.     fi
  1891. done
  1892. if test "${MISSING}" = "" ; then
  1893.     echo You have unpacked all 9 archives.
  1894.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1895. else
  1896.     echo You still need to unpack the following archives:
  1897.     echo "        " ${MISSING}
  1898. fi
  1899. ##  End of shell archive.
  1900. exit 0
  1901.